package Utils;

import java.util.ArrayList;

import model.MenuSubItem;
import model.MenuItem;

public class Utility {

	
	public static ArrayList<MenuSubItem> FindSubMenus(ArrayList<MenuItem> menuItemList)
	{
		ArrayList<MenuSubItem> menuChild=new ArrayList<MenuSubItem>();
		
		for (MenuItem menuItem : menuItemList) 
		{
			if(menuItem.get_parentMenuId()!=0)
			{
				MenuSubItem obj=new MenuSubItem();
				obj.set_menuName(menuItem.get_menuName());
				obj.set_parentMenuId(menuItem.get_parentMenuId());
				menuChild.add(obj);
			}
		}
		
		return menuChild;
	}
}
